<html>
<head><meta charset="utf-8"><title>Compile-time option for minimum Linux version? · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html">Compile-time option for minimum Linux version?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="189973190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/189973190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#189973190">(Mar 07 2020 at 14:51)</a>:</h4>
<p>std includes various workarounds to run on <em>ancient</em> Linux kernels (like 2.6.18). I'm potentially interested in introducing an option for "minimum supported Linux kernel version", which would allow omitting those workarounds. glibc has a similar option. Does that seem like a reasonable thing to do? (It'll have more value in the future when programs can easily compile their own <code>std</code> via cargo, but it'd still be usable for people or distros who build their own Rust.)</p>



<a name="189980191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/189980191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#189980191">(Mar 07 2020 at 18:11)</a>:</h4>
<p>do we know if those workarounds have runtime costs? I'm not sure if the complexity of such an option is worth it otherwise.</p>



<a name="189980194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/189980194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#189980194">(Mar 07 2020 at 18:11)</a>:</h4>
<p>(I assume they do? Not sure how much of one though).</p>



<a name="190014657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190014657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190014657">(Mar 08 2020 at 13:54)</a>:</h4>
<p>I would also wonder how much value there would be in providing that option versus raising the overall minimum supported linux version of <code>std</code>? If these workarounds are a problem, it might be worth considering whether they should included at all. Especially if they are EOL.</p>



<a name="190022729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190022729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190022729">(Mar 08 2020 at 18:16)</a>:</h4>
<p>They do have runtime costs, quite aside from complexity.</p>



<a name="190022734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190022734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190022734">(Mar 08 2020 at 18:17)</a>:</h4>
<p>Several extra system calls.</p>



<a name="190022790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190022790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190022790">(Mar 08 2020 at 18:18)</a>:</h4>
<p><span class="user-mention" data-user-id="219696">@XAMPPRocky</span> I do agree that we should consider raising the minimum. But I'm also thinking about future cases as well; I might want to build std to require Linux 5.5 for instance.</p>



<a name="190022800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190022800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190022800">(Mar 08 2020 at 18:19)</a>:</h4>
<p>Imagine a future version of std with support for io_uring, for example.</p>



<a name="190022802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190022802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190022802">(Mar 08 2020 at 18:19)</a>:</h4>
<p>Or restartable sequences.</p>



<a name="190034530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190034530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190034530">(Mar 09 2020 at 00:41)</a>:</h4>
<p>On raising the minimum, I think I'm the main holdout, or at least the only vocal one, for the sake of RHEL6. That's actually 2.6.32, but our internal builders tend to remain N-1 hosts, so those use RHEL5's 2.6.18.</p>



<a name="190034590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190034590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190034590">(Mar 09 2020 at 00:43)</a>:</h4>
<p>When RHEL6 goes out of support, ~Nov 2020, I'll be ready to bump the minimum accordingly.</p>



<a name="190034634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190034634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190034634">(Mar 09 2020 at 00:44)</a>:</h4>
<p>See also <a href="https://github.com/rust-lang/rust/issues/62516" target="_blank" title="https://github.com/rust-lang/rust/issues/62516">https://github.com/rust-lang/rust/issues/62516</a></p>



<a name="190122561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Compile-time%20option%20for%20minimum%20Linux%20version%3F/near/190122561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Compile-time.20option.20for.20minimum.20Linux.20version.3F.html#190122561">(Mar 09 2020 at 22:02)</a>:</h4>
<p>Well it's not just me -- here's someone explicitly using el5: <a href="https://github.com/rust-lang/rust/issues/69862" target="_blank" title="https://github.com/rust-lang/rust/issues/69862">https://github.com/rust-lang/rust/issues/69862</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>